Shell programs, also known as command language processor programs, are a layer of software programs above a computer's operation system that allow users to submit commonly used commands to the computer without having to write a complicated program. Examples of such commands include those for copying files stored on disk, printing specified files, running specified programs, directing the output of programs, checking on various aspects of the computer's status, and so on.
Frequently used sequences of commands are often stored in a text file, herein called a script, and then the script is submitted to the computer's shell program. This avoids having an operator or user re-enter these sequences of commands over and over. Some examples of scripts are bootstrap start procedures, backup procedures, system shutdown procedures, log-in procedures, and even program execution procedures for commonly used programs. The shell program serially presents the commands obtained from the script to the computer's operating system for execution.
Each computer's shell program typically has a language and syntax of its own, allowing the shell program to make decisions (such as to skip over a section of commands to a specified point in the script if a certain condition exists), interrogate the operating system (e.g., to determine whether a particular file exists), display messages on a computer terminal, etc.
Some prior art shells allow concurrent, asynchronous execution of commands, by spawning child processes, each of which acts as a totally separate and detached process. This allows parallel execution of multiple scripts, but does not allow the shell to directly synchronize or otherwise communicate with its child processes, because each child process operates in a distinct address space. While it is possible to synchronize separate processes, such synchronization is not inherent in prior art shell programs, and it falls upon the script writer to invent indirect methods of synchronization--which methods are often obscure to future maintainers of the software and costly in terms of resources and execution time.
The present invention allows script writers to explicitly define two or more parallel sequences of commands and to synchronize the execution of those command sequences. The execution of parallel sequences of commands within the shell is split into cooperating threads of execution all of which share a common address space, as opposed to separate processes with distinct address spaces. Since all the threads share a common address space, the shell program of the present invention has the inherent ability to synchronize on specified steps of execution and their individual statuses. For instance, the execution of a particular command or sequence of commands can be made dependent on the successful completion of several other sequences of commands that were executed in parallel.